var person = {
    firstName: "su",
    lastName: "zhang",
    fullName:function(){
        return this.firstName+' '+this.lastName;
    }
};
//对象内函数
console.log(person.fullName());
//对象属性调用
console.log(person.firstName+' '+person['lastName']);

console.log('-----------------------');
class Runoob{
    constructor(name,year){
        this.name=name;
        this.year=year;
    }

    age(){
        return new Date().getFullYear()-this.year;
    }

    static hello(){
        return "hello";
    }
}

var runoob=new Runoob('suzhang',2000);
console.log(runoob.age());

console.log(Runoob.hello());
